﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pattern_Memento
{
    class Originator
    {
        public string State = string.Empty;

        public void SetMemento(Memento m)
        {
            State = m.State;
        }

        public Memento CreateMemento()
        {
            Memento m = new Memento();
            m.State = State;
            return m;
        }

        public void Show()
        {
            Console.WriteLine(State);
            Console.WriteLine();
        }
    }

    class Memento
    {
        public string State = string.Empty;
    }

    class Caretaker
    {
        public Memento memento;
    }
}
